package com.mttest.hotwords.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author sunqy
 * @description
 * @create 2020-09-01 10:33
 */
@TableName("search_log")
public class SearchLog {
    @TableId(type = IdType.AUTO)
    private Long id;

    private String word;

    private Date time;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getWord() {
        return word;
    }

    public void setWord(String word) {
        this.word = word;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public static SearchLog newSearchLog(String word){
        Date time = new Date();
        SearchLog searchLog = new SearchLog();
        searchLog.setWord(word);
        searchLog.setTime(time);
        return searchLog;
    }
}
